const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  runtimeCompiler: true,
  publicPath: './',
  css: {
    loaderOptions: {
      sass: {
        additionalData: `@import "./src/assets/scss/theme.scss";`,
      },
    },
  },
  pluginOptions: {
    electronBuilder: {
      nodeIntegration: false,
      customFileProtocol: './',
      preload: 'src/preload.ts',
      builderOptions: {
        productName: 'Envor',
        appId: 'com.jl15988.envor',
        copyright: 'Copyright (c) 2024 会功夫的李白',
        nsis: {
          oneClick: false,
          allowElevation: true,
          allowToChangeInstallationDirectory: true,
          installerIcon: "./public/favicon.ico",
          uninstallerIcon: "./public/favicon.ico",
          installerHeaderIcon: "./public/favicon.ico",
          createDesktopShortcut: true,
          createStartMenuShortcut: true,
          shortcutName: 'Envor',
          perMachine: true
        },
        win: {
          icon: './public/favicon.ico',
          artifactName: '${productName}_setup_${version}.${ext}'
        }
      }
    }
  }
})
